import unittest


class Calculator:
    def __init__(self):
        self.memory = 0

    def add(self, x):
        self.memory += x

    def clear(self):
        self.memory = 0


class TestCalculator(unittest.TestCase):
    def setUp(self):
        self.calc = Calculator()

    def test_add(self):
        self.calc.add(5)
        self.assertEqual(self.calc.memory, 5)

    def test_clear(self):
        self.calc.add(5)
        self.calc.clear()
        self.assertEqual(self.calc.memory, 0)

    def tearDown(self):
        print("Test completed.")
